<html><head><title>api.engine</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><link rel="stylesheet" type="text/css" href="../../styles/prettify.css"><script language=JavaScript src="../../javascript/prettify.js"></script><script language=JavaScript src="../../javascript/main.js"></script></head><body class="FramedContentPage" onLoad="{NDOnLoad();prettyPrint();}"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.4 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="api.engine"></a>api.<wbr>engine</h1><div class=CBody><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#api.engine" >api.<wbr>engine</a></td><td class=SDescription></td></tr><tr class="SClass"><td class=SEntry><a href="#api.engine.BruteForceEngine" >api.<wbr>engine.<wbr>BruteForceEngine</a></td><td class=SDescription>extends <a href="../system/EventDispatcher-js.html#api.system.EventDispatcher" class=LClass >api.system.EventDispatcher</a></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#api.engine.BruteForceEngine.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#api.engine.BruteForceEngine.BruteForceEngine" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">BruteForceEngine</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#api.engine.BruteForceEngine.getBodyDomElement" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">getBodyDomElement</a></td><td class=SDescription>returns the body wrapped in <a href="../DomElement-js.html#api.DomElement" class=LClass id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">api.DomElement</a> object</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#api.engine.BruteForceEngine.addVisualElement" >addVisualElement</a></td><td class=SDescription>if parent is undefined, <a href="#api.engine.BruteForceEngine.getBodyDomElement" class=LFunction id=link4 onMouseOver="ShowTip(event, 'tt2', 'link4')" onMouseOut="HideTip('tt2')">getBodyDomElement</a> will be used as parent, otherwise the parent provided wrapped in <a href="../DomElement-js.html#api.DomElement" class=LClass id=link5 onMouseOver="ShowTip(event, 'tt3', 'link5')" onMouseOut="HideTip('tt3')">api.DomElement</a></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#api.engine.BruteForceEngine.addVisualElementAt" >addVisualElementAt</a></td><td class=SDescription>adds visual element to given domElement by parentId</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#api.engine.BruteForceEngine.removeVisualElement" >removeVisualElement</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#api.engine.BruteForceEngine.getVisualElementIndex" >getVisualElementIndex</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#api.engine.BruteForceEngine.registerTweenFunction" id=link6 onMouseOver="ShowTip(event, 'tt4', 'link6')" onMouseOut="HideTip('tt4')">registerTweenFunction</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#api.engine.BruteForceEngine.unregisterTweenFunction" id=link7 onMouseOver="ShowTip(event, 'tt5', 'link7')" onMouseOut="HideTip('tt5')">unregisterTweenFunction</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#api.engine.BruteForceEngine.start" id=link8 onMouseOver="ShowTip(event, 'tt6', 'link8')" onMouseOut="HideTip('tt6')">start</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#api.engine.BruteForceEngine.requestProcessTick" id=link9 onMouseOver="ShowTip(event, 'tt7', 'link9')" onMouseOut="HideTip('tt7')">requestProcessTick</a></td><td class=SDescription>useful in mode != &lsquo;interval&rsquo;. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="api.engine.BruteForceEngine"></a>api.<wbr>engine.<wbr>BruteForceEngine</h2><div class=CBody><p>extends <a href="../system/EventDispatcher-js.html#api.system.EventDispatcher" class=LClass >api.system.EventDispatcher</a></p><h4 class=CHeading>BruteForce engine does the following when started</h4><ul><li>iterates over all VEs added to it and their childs on every tick by:</li><li>0) process animation logic</li><li>1) measure VEs by invoke to VE.getLayout.measureChilds()</li><li>2) position VEs by invoke to VE.getLayout.positionChilds()</li><li>3) renders VEs (to document DOM or Canvas)</li><li>3.1) invokes beforeRender of VE.getRenderer() if exists</li><li>3.2) invokes render of VE.getRenderer()</li><li>3.3) invokes afterRender of VE.getRenderer if exists</li></ul><p>BruteForce engine can be started with one of the two modes supported bellow</p><ul><li>request -&gt; which is a mode without constant running interval, bur rather timeout is fired when some VE had requested Engine Tick. when tween is registered interval loop is created until the tween is unregistered from the engine.</li><li>interval -&gt; which is a mode with constant running interval.&nbsp; In this use case VE&rsquo;s request for Engine Tick does not get into work, as there is interval running all the time.</li></ul><p>Default mode is &lsquo;interval&rsquo; as it is more stable atm of writing this documentation.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#api.engine.BruteForceEngine.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#api.engine.BruteForceEngine.BruteForceEngine" id=link10 onMouseOver="ShowTip(event, 'tt1', 'link10')" onMouseOut="HideTip('tt1')">BruteForceEngine</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#api.engine.BruteForceEngine.getBodyDomElement" id=link11 onMouseOver="ShowTip(event, 'tt2', 'link11')" onMouseOut="HideTip('tt2')">getBodyDomElement</a></td><td class=SDescription>returns the body wrapped in <a href="../DomElement-js.html#api.DomElement" class=LClass id=link12 onMouseOver="ShowTip(event, 'tt3', 'link12')" onMouseOut="HideTip('tt3')">api.DomElement</a> object</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#api.engine.BruteForceEngine.addVisualElement" >addVisualElement</a></td><td class=SDescription>if parent is undefined, <a href="#api.engine.BruteForceEngine.getBodyDomElement" class=LFunction id=link13 onMouseOver="ShowTip(event, 'tt2', 'link13')" onMouseOut="HideTip('tt2')">getBodyDomElement</a> will be used as parent, otherwise the parent provided wrapped in <a href="../DomElement-js.html#api.DomElement" class=LClass id=link14 onMouseOver="ShowTip(event, 'tt3', 'link14')" onMouseOut="HideTip('tt3')">api.DomElement</a></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#api.engine.BruteForceEngine.addVisualElementAt" >addVisualElementAt</a></td><td class=SDescription>adds visual element to given domElement by parentId</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#api.engine.BruteForceEngine.removeVisualElement" >removeVisualElement</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#api.engine.BruteForceEngine.getVisualElementIndex" >getVisualElementIndex</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#api.engine.BruteForceEngine.registerTweenFunction" id=link15 onMouseOver="ShowTip(event, 'tt4', 'link15')" onMouseOut="HideTip('tt4')">registerTweenFunction</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#api.engine.BruteForceEngine.unregisterTweenFunction" id=link16 onMouseOver="ShowTip(event, 'tt5', 'link16')" onMouseOut="HideTip('tt5')">unregisterTweenFunction</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#api.engine.BruteForceEngine.start" id=link17 onMouseOver="ShowTip(event, 'tt6', 'link17')" onMouseOut="HideTip('tt6')">start</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#api.engine.BruteForceEngine.requestProcessTick" id=link18 onMouseOver="ShowTip(event, 'tt7', 'link18')" onMouseOut="HideTip('tt7')">requestProcessTick</a></td><td class=SDescription>useful in mode != &lsquo;interval&rsquo;. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="api.engine.BruteForceEngine.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.engine.BruteForceEngine.BruteForceEngine"></a>BruteForceEngine</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>BruteForceEngine : function(</td><td class=PParameter nowrap>layout</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.engine.BruteForceEngine.getBodyDomElement"></a>getBodyDomElement</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>getBodyDomElement : function()</td></tr></table></blockquote><p>returns the body wrapped in <a href="../DomElement-js.html#api.DomElement" class=LClass id=link19 onMouseOver="ShowTip(event, 'tt3', 'link19')" onMouseOut="HideTip('tt3')">api.DomElement</a> object</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.engine.BruteForceEngine.addVisualElement"></a>addVisualElement</h3><div class=CBody><p>if parent is undefined, <a href="#api.engine.BruteForceEngine.getBodyDomElement" class=LFunction id=link20 onMouseOver="ShowTip(event, 'tt2', 'link20')" onMouseOut="HideTip('tt2')">getBodyDomElement</a> will be used as parent, otherwise the parent provided wrapped in <a href="../DomElement-js.html#api.DomElement" class=LClass id=link21 onMouseOver="ShowTip(event, 'tt3', 'link21')" onMouseOut="HideTip('tt3')">api.DomElement</a></p><p>note: the parent should be DomElement object</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.engine.BruteForceEngine.addVisualElementAt"></a>addVisualElementAt</h3><div class=CBody><p>adds visual element to given domElement by parentId</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.engine.BruteForceEngine.removeVisualElement"></a>removeVisualElement</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.engine.BruteForceEngine.getVisualElementIndex"></a>getVisualElementIndex</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.engine.BruteForceEngine.registerTweenFunction"></a>registerTweenFunction</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>registerTweenFunction : function(</td><td class=PParameter nowrap>ve,</td></tr><tr><td></td><td class=PParameter nowrap>method</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.engine.BruteForceEngine.unregisterTweenFunction"></a>unregisterTweenFunction</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>unregisterTweenFunction : function(</td><td class=PParameter nowrap>ve,</td></tr><tr><td></td><td class=PParameter nowrap>method</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.engine.BruteForceEngine.start"></a>start</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>start : function(</td><td class=PParameter nowrap>framerate,</td></tr><tr><td></td><td class=PParameter nowrap>mode</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>params</h4><ul><li>framerate is in milisecs interval or delay upon processing tick</li><li>mode is &lsquo;interval&rsquo; | &lsquo;request&rsquo; read the summary of the engine for info</li></ul></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.engine.BruteForceEngine.requestProcessTick"></a>requestProcessTick</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>requestProcessTick : function(</td><td class=PParameter nowrap>initiator</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>useful in mode != &lsquo;interval&rsquo;. registers timeout function with the specified at <a href="#api.engine.BruteForceEngine.start" class=LFunction id=link22 onMouseOver="ShowTip(event, 'tt6', 'link22')" onMouseOut="HideTip('tt6')">start</a> framerate as delay</p></div></div></div>

</div><!--Content-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>BruteForceEngine : function(</td><td class=PParameter nowrap>layout</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>getBodyDomElement : function()</td></tr></table></blockquote>returns the body wrapped in api.DomElement object</div></div><div class=CToolTip id="tt3"><div class=CClass>This class is a wrapper object used within api.engine.BruteForce with target &ldquo;document.body&rdquo;.</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>registerTweenFunction : function(</td><td class=PParameter nowrap>ve,</td></tr><tr><td></td><td class=PParameter nowrap>method</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>unregisterTweenFunction : function(</td><td class=PParameter nowrap>ve,</td></tr><tr><td></td><td class=PParameter nowrap>method</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>start : function(</td><td class=PParameter nowrap>framerate,</td></tr><tr><td></td><td class=PParameter nowrap>mode</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>requestProcessTick : function(</td><td class=PParameter nowrap>initiator</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>useful in mode != &lsquo;interval&rsquo;. </div></div><!--END_ND_TOOLTIPS-->

<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>